﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;

namespace WMS_Api.Areas
{
    /// <summary>
    /// 
    /// </summary>
    public class CustomAreaRegistration : AreaRegistration
    {
        /// <summary>
        /// 
        /// </summary>
        public override string AreaName
        {
            get
            {
                return "Custom";
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="context"></param>
        public override void RegisterArea(AreaRegistrationContext context)
        {
            var areaName = this.AreaName;
            context.MapRoute(
                areaName + "_default",
                areaName + "/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
            context.Routes.MapHttpRoute(
                areaName + "_area",
                $"api/{areaName}" + "/{controller}/{action}/{id}",
                defaults: new { area = areaName, action = "index", id = UrlParameter.Optional }
            );
        }
    }
}